#ifndef DEVICE_H
#define DEVICE_H

#include <QObject>
#include <QUdpSocket>
#include <QTimer>

class Device :public QObject
{
    Q_OBJECT
public:
    explicit Device(QObject *parent = nullptr);
    void startDiscovery();
signals:
    void deviceFound(QString ip, QString name);
private slots:
    void readPendingDatagrams();
private:
    QUdpSocket *m_udpSocket;
    QTimer *m_discoveryTimer;
};

#endif // DEVICE_H

